package project

import (
	"context"
	"gf-assistant/internal/common/factory"
	"gf-assistant/internal/project/parameter"
)

type ProjectController struct{ service string }

var Project = ProjectController{service: "project.ProjectService"}

func GetProjectService() *ProjectService {
	return factory.Get(Project.service).(*ProjectService)
}

func (c *ProjectController) GetProject(ctx context.Context, req *parameter.GetProjectReq) (res *parameter.GetProjectRes, err error) {
	return GetProjectService().GetProject(ctx, req), nil
}

func (c *ProjectController) ListProject(ctx context.Context, req *parameter.ListProjectReq) (res *parameter.ListProjectRes, err error) {
	return GetProjectService().ListProject(ctx, req), nil
}

func (c *ProjectController) CreateProject(ctx context.Context, req *parameter.CreateProjectReq) (res *parameter.CreateProjectRes, err error) {

	return GetProjectService().CreateProject(ctx, req), nil
}
func (c *ProjectController) SaveProject(ctx context.Context, req *parameter.SaveProjectReq) (res *parameter.SaveProjectRes, err error) {

	return GetProjectService().SaveProject(ctx, req), nil
}
func (c *ProjectController) DeleteProject(ctx context.Context, req *parameter.DeleteProjectReq) (res *parameter.DeleteProjectRes, err error) {

	return GetProjectService().DeleteProject(ctx, req), nil
}
func (c *ProjectController) GetProjectTree(ctx context.Context, req *parameter.GetProjectTreeReq) (res *parameter.GetProjectTreeRes, err error) {
	return GetProjectService().GetProjectTree(ctx, req), nil
}
func (c *ProjectController) GetProjectCombox(ctx context.Context, req *parameter.GetProjectComboxReq) (res *parameter.GetProjectComboxRes, err error) {
	return GetProjectService().GetProjectCombox(ctx, req), nil
}
